function foo() {
  function bat() {
    console.log("bat");
  }
  return bat;
}
var fn = foo();
fn();
